Skip to content

fix(nooa-bench): always persist traces and dump a local trajectory - #69

Merged
rdasilveiracabral merged 1 commit into
mainfrom
fix/bench-trace-persistence
Jul 31, 2026
Merged

fix(nooa-bench): always persist traces and dump a local trajectory#69
rdasilveiracabral merged 1 commit into
mainfrom
fix/bench-trace-persistence

Conversation

@rdasilveiracabral

Copy link
Copy Markdown
Collaborator

Problem

A Harbor run could finish with no trajectory stored anywhere on disk, which blocks post-hoc failure analysis. This was hit in practice — reported as:

"it appears that nooa does not have locally stored full trajectory? I could not find it in, say, nooa-base_ultra_on/astropy__astropy-14598__7oCi6qh/agent"

Two independent causes.

1. The exporter choice was mutually exclusive

_setup_tracing() installed either the streaming journal exporter or the JSONL file exporter:

if probe_otlp_endpoint(endpoint):
    enable_tracing(exporters=[nemo_exporters.journal(endpoint=endpoint)])
else:
    enable_tracing(exporters=[nemo_exporters.jsonl(TRACES_DIR)])

Benchmark configs set OTLP_ENDPOINT, so those runs streamed spans to the viewer and wrote nothing locally. If the viewer was down, restarted, or the network blipped, the trajectory was simply gone.

2. Nothing wrote per-turn history where anyone looks for it

The per-task agent/ directory held only nooa_bench.log and result.json — and result.json carries just the final response. So the directory named in the report above was genuinely empty of trajectory data under either branch, since JSONL goes to /logs/artifacts/traces/.

Changes

  • The JSONL file exporter is now unconditional; the journal exporter is added alongside it when OTLP_ENDPOINT is reachable. Live viewing no longer costs the durable copy.
  • Add _write_trajectory(), dumping the agent's full event history to agent/trajectory.json.
  • extra_resource_attrs (eval.model, eval.agent_type) now apply in both cases, not just the streaming one, so file-only runs stay attributable.

Notes

Trajectory serialisation failures are logged and swallowed — a debug artifact must never fail a task. The OTLP spans under /logs/artifacts/traces/ remain the canonical record; trajectory.json is the greppable companion.

🤖 Generated with Claude Code

Two independent gaps meant a Harbor run could finish with no trajectory
stored anywhere on disk, which blocked post-hoc failure analysis.

1. The exporter choice was mutually exclusive: when OTLP_ENDPOINT was
   reachable the runner installed only the streaming journal exporter, and
   the JSONL file exporter lived in the else branch. Benchmark configs set
   OTLP_ENDPOINT, so those runs streamed spans to the viewer and wrote
   nothing locally. The file exporter is now unconditional and the journal
   exporter is added alongside it.

2. Nothing wrote per-turn history into the per-task agent/ directory --
   it held only nooa_bench.log and a result.json carrying just the final
   response. Add _write_trajectory(), dumping the agent's full event
   history to agent/trajectory.json where failure analysis actually looks.

extra_resource_attrs (eval.model, eval.agent_type) are now applied in both
branches rather than only the streaming one, so file-only runs stay
attributable to their model and agent type.

Trajectory serialisation failures are logged and swallowed -- a debug
artifact must never fail the task.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@rdasilveiracabral
rdasilveiracabral merged commit 994cb86 into main Jul 31, 2026
5 checks passed
@rdasilveiracabral
rdasilveiracabral deleted the fix/bench-trace-persistence branch July 31, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant